package com.hongshan.wallet.core.comm

import android.arch.lifecycle.ViewModelProviders
import android.databinding.ViewDataBinding
import android.os.Bundle
import com.alibaba.android.arouter.facade.annotation.Route
import com.hongshan.wallet.BR
import com.hongshan.wallet.Constant
import com.hongshan.wallet.R
import com.hongshan.wallet.base.MyActivity
import com.hongshan.wallet.router.RouterIndex
import kotlinx.android.synthetic.main.activity_send_sms.*
import kotlinx.android.synthetic.main.appbar.*

/**
 * Copyright Zhangxx.
 * Copyright (c) 2019
 * All rights reserved
 *
 * @project  : Wallet
 * @package  : com.example.wallet.core.bankcard
 * @author   : zhangxx
 * @date     : 2019/3/29
 * @email    : qq957413212@hotmail.com
 * @desc     : //TODO
 */
@Route(path = RouterIndex.SEND_SMS)
class SendSmsActivity : MyActivity<ViewDataBinding, SendSmsViewModel>() {

    override fun initVariableId() = BR.vm

    override fun initContentView(savedInstanceState: Bundle?) = R.layout.activity_send_sms

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        viewModel.bundle = intent.extras
        val title = viewModel.bundle?.getString(Constant.ROUTE_PARAMS_KEY.SMS_TITLE)
        if (title!=null) {
            tvTitle.text = title
        }
        val buttonStr = viewModel.bundle?.getString(Constant.ROUTE_PARAMS_KEY.SMS_BUTTON)
        if (buttonStr!=null) {
            tvComplete.text = buttonStr
        }
    }

    override fun initViewModel(): SendSmsViewModel = ViewModelProviders.of(this)[SendSmsViewModel::class.java]
}